home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / amislate / slaterexx / ghostcircle.rexx < prev    next >
OS/2 REXX Batch file  |  1995-08-05  |  2KB  |  67 lines

  1. /* GhostCircle.rexx
  2.  
  3.    An ARexx script designed to work with AmiSlate.
  4.    
  5.    An eerie circle-like being follows your mouse pointer
  6.    around the screen... 
  7.    
  8. */
  9. parse arg CommandPort ActiveString
  10.  
  11. if (length(CommandPort) == 0) then do
  12.     say ""
  13.     say "Usage:  rx ghostcircle.rexx <REXXPORTNAME>"
  14.     say "        (REXXPORTNAME is usually AMISLATE)"
  15.     say ""
  16.     say "Or run from the Rexx menu within AmiSlate."
  17.     say ""
  18.     exit 0
  19.     end
  20.     
  21.  
  22. address (CommandPort)
  23. options results
  24.  
  25. /* Constants for use with AmiSlate's ARexx interface */
  26. AMessage.TIMEOUT     = 1    /* No events occurred in specified time period */
  27. AMessage.MESSAGE     = 2    /* Message recieved from remote Amiga */
  28. AMessage.MOUSEDOWN   = 4    /* Left mouse button press in drawing area */
  29. AMessage.MOUSEUP     = 8    /* Left mouse button release in drawing area */
  30. AMessage.RESIZE      = 16    /* Window was resized--time to redraw screen? */
  31. AMessage.QUIT        = 32    /* AmiSlate is shutting down */
  32. AMessage.CONNECT     = 64    /* Connection established */
  33. AMessage.DISCONNECT  = 128    /* Connection broken */
  34. AMessage.TOOLSELECT  = 256    /* Tool Selected */
  35. AMessage.COLORSELECT = 512    /* Palette Color selected */
  36. AMessage.KEYPRESS    = 1024    /* Key pressed */
  37. AMessage.MOUSEMOVE   = 2048     /* Mouse moved */
  38.  
  39. WaitEvent 1 stem e.
  40. oldX = e.mousex
  41. oldY = e.mousey
  42.  
  43. /* default radius */
  44.  
  45. StringRequest stem message. '"'||"GhostCircle Request"||'"' 6 '"'||"Radius of the circle?"||'"'
  46. cRadius = message.message
  47.  
  48. if (cRadius < 1) then cRadius = 6
  49.  
  50. circle oldX oldY cRadius cRadius XOR FILL
  51.  
  52. do while (1=1)
  53.     WaitEvent QUIT MOUSEMOVE stem e.
  54.     t = e.type
  55.     
  56.     if (t = AMessage.QUIT) then exit    
  57.     if (t = AMessage.MOUSEMOVE) then do
  58.         circle oldX oldY cRadius cRadius XOR FILL
  59.         circle e.mousex e.mousey cRadius cRadius XOR FILL
  60.         oldX = e.mousex
  61.         oldY = e.mousey
  62.         end            
  63.     
  64.     e.type = 0
  65.     end
  66.  
  67.